/**
 * Created by beck on 2015/8/19.
 */
$(document).ready(function(){
	$(".turnback a").attr("href","trends.html?mid="+getUrlParam("mid")+"&groupid="+getUrlParam("groupid"));
    var $token = window.localStorage.getItem("token");
    var $mid = window.localStorage.getItem("mid");
    var $groupid= window.localStorage.getItem("groupId");
    var Post ="mid="+$mid+"&groupid="+$groupid+"&dynid="+getUrlParam("did")+"&token="+$token+"&did=22222";
    $.ajax({
        url:'../api/group/getgroupdynamicinfoObject',
        type:'post',
        data:Post,
        success:function(msg){
            if(msg.code==100){
                $("h3").html(msg.datum.n2);
                $("#img").attr("src",msg.datum.n1);
                $("#time").html(msg.datum.n4.substring(0,10));
                $("#content").html(msg.datum.n3);
                $("#comcount").html(msg.datum.n5);
                $("#zancount").html(msg.datum.n6);
                if(msg.datum.n7 ==1){
                    $("#zan").attr("src","../source/images/Teal_heart.png");
                }else{
                    $("#zan").attr("src","../source/images/Red_heart.png");
                }
            }
        }
    });
});
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}